﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Zj.HttpCodeDemo.Domain.Events
{
    public  interface IEventHandler
    {
        bool CanHandle(IEvent @event);
        Task<bool> HandleAsync(IEvent @event,CancellationToken cancellationToken=default(CancellationToken));
    }
    public  interface IEventHandler<TEvent>
        : IEventHandler
    {
        Task<bool> HandleAsync(TEvent @event, CancellationToken cancellationToken = default(CancellationToken));
    }
}
